﻿/// <reference path="../GeneratedArtifacts/viewModel.js" />

myapp.Main.ScreenContent_render = function (element, contentItem) {
    element.innerHTML = "<h1>Popup without centering</h1>";
};
myapp.Main.ScreenContent1_render = function (element, contentItem) {
    element.innerHTML = "<h1>Popup with centering</h1>";
};
myapp.Main.ShowCenteredPopup_execute = function (screen) {
    // Note:If using JQuery Mobile 1.3 (or higher) use:
    // "popupcreate" rather than "popupbeforeposition"

    // An event handler to be fired before a popup is shown 
    // to override the popup positionTo option 
    // using "window" instead of "origin"
    $(window).one("popupbeforeposition", function (e) {
        $(e.target).popup({
            positionTo: "window"
        });
    });

    // Show the Popup
    screen.showPopup("Centered");
};